import { ajax } from '../http.js';

const SendCodeUrl = '/shortMessage/send_code'; // 发送验证码
const CheckCodeUrl = '/shortMessage/check_code'; // 用于校验旧手机短信验证码（用于修改手机号)

const SendCode = (data, success, fail) => {
  data = Object.assign(data, {
    token: uni.getStorageSync('user_token')
  });
  ajax({
    noAuth: true,
    url: SendCodeUrl,
    data: data,
    success: success,
    fail: fail
  });
};

const CheckCode = (data, success, fail) => {
  ajax({
    noAuth: true,
    url: CheckCodeUrl,
    data: data,
    success: success,
    fail: fail
  });
};


export {
  SendCode,
  CheckCode
};
